package com.neusoft.neuiotms.dcom.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcom.dto.HandoverItemDTO;
import com.neusoft.neuiotms.dcom.model.HandoverItem;

@Component
public class HandoverItemConverter extends AbstractConverter<HandoverItem, HandoverItemDTO> {

    @Override
    public HandoverItem toModel(final HandoverItemDTO dto) {

        final HandoverItem model = new HandoverItem();

        model.setName(dto.getName());
        model.setIsRequired(dto.getIsRequired());

        return model;
    }

    @Override
    public HandoverItemDTO toDTO(final HandoverItem model, final boolean forListView) {

        final HandoverItemDTO dto = new HandoverItemDTO();

        dto.setId(model.getId());
        dto.setName(model.getName());
        dto.setIsRequired(model.getIsRequired());

        return dto;
    }

}
